home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / graphics / picscrol.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-05-16  |  2.3 KB  |  77 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Picture Scroll Demonstration"
  5.    ClientHeight    =   3720
  6.    ClientLeft      =   1095
  7.    ClientTop       =   1485
  8.    ClientWidth     =   4425
  9.    Height          =   4125
  10.    Left            =   1035
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3720
  14.    ScaleWidth      =   4425
  15.    Top             =   1140
  16.    Width           =   4545
  17.    Begin PictureBox Picture1 
  18.       Height          =   3255
  19.       Left            =   120
  20.       ScaleHeight     =   3225
  21.       ScaleWidth      =   3945
  22.       TabIndex        =   0
  23.       Top             =   120
  24.       Width           =   3975
  25.       Begin PictureBox Picture2 
  26.          AutoSize        =   -1  'True
  27.          BorderStyle     =   0  'None
  28.          Height          =   7200
  29.          Left            =   -1800
  30.          Picture         =   PICSCROL.FRX:0000
  31.          ScaleHeight     =   7200
  32.          ScaleWidth      =   9600
  33.          TabIndex        =   1
  34.          Top             =   -960
  35.          Width           =   9600
  36.       End
  37.    End
  38.    Begin VScrollBar VScroll1 
  39.       Height          =   3255
  40.       Left            =   4080
  41.       SmallChange     =   10
  42.       TabIndex        =   3
  43.       Top             =   120
  44.       Width           =   255
  45.    End
  46.    Begin HScrollBar HScroll1 
  47.       Height          =   255
  48.       Left            =   120
  49.       SmallChange     =   10
  50.       TabIndex        =   2
  51.       Top             =   3360
  52.       Width           =   3975
  53.    End
  54. Sub Form_Load ()
  55.     picture2_change
  56. End Sub
  57. Sub HScroll1_Change ()
  58.     picture2.left = picture1.left - hscroll1.value
  59. End Sub
  60. Sub picture2_change ()
  61.     vscroll1.min = picture1.top
  62.     hscroll1.min = picture1.left
  63.     vscroll1.max = picture2.height - picture1.height
  64.     If vscroll1.max < vscroll1.min Then
  65.         vscroll1.max = vscroll1.min
  66.     End If
  67.     hscroll1.max = picture2.width - picture1.width
  68.     If hscroll1.max < hscroll1.min Then
  69.         hscroll1.max = hscroll1.min
  70.     End If
  71.     vscroll1.LargeChange = picture2.height / 10
  72.     hscroll1.LargeChange = picture2.width / 10
  73. End Sub
  74. Sub VScroll1_Change ()
  75.     picture2.top = picture1.top - vscroll1.value
  76. End Sub
  77.